home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / XAMPP 1.4.14 / xampp-win32-1.4.14-installer.exe / xampp / phpMyAdmin / libraries / display_export.lib.php < prev    next >
PHP Script  |  2005-03-06  |  45KB  |  778 lines

  1. <?php
  2. /* $Id: display_export.lib.php,v 2.30 2005/03/06 21:18:29 nijel Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5. // Get relations & co. status
  6. require_once('./libraries/relation.lib.php');
  7. $cfgRelation = PMA_getRelationsParam();
  8.  
  9. // Check if we have native MS Excel export using PEAR class Spreadsheet_Excel_Writer
  10. if (!empty($GLOBALS['cfg']['TempDir'])) {
  11.     @include_once('Spreadsheet/Excel/Writer.php');
  12.     if (class_exists('Spreadsheet_Excel_Writer')) {
  13.         $xls = TRUE;
  14.     } else {
  15.         $xls = FALSE;
  16.     }
  17. } else {
  18.     $xls = FALSE;
  19. }
  20.  
  21. function PMA_exportCheckboxCheck($str) {
  22.     if (isset($GLOBALS['cfg']['Export'][$str]) && $GLOBALS['cfg']['Export'][$str]) {
  23.         echo ' checked="checked"';
  24.     }
  25. }
  26.  
  27. function PMA_exportIsActive($what, $val) {
  28.     if (isset($GLOBALS['cfg']['Export'][$what]) &&  $GLOBALS['cfg']['Export'][$what] == $val) {
  29.         echo ' checked="checked"';
  30.     }
  31. }
  32.  
  33. ?>
  34. <form method="post" action="export.php" name="dump">
  35. <?php
  36. $hide_structure = false;
  37. $hide_sql       = false;
  38. $hide_xml       = empty($db);
  39. if ($export_type == 'server') {
  40.     echo PMA_generate_common_hidden_inputs('', '', 1);
  41. } elseif ($export_type == 'database') {
  42.     echo PMA_generate_common_hidden_inputs($db, '', 1);
  43. } else {
  44.     echo PMA_generate_common_hidden_inputs($db, $table, 1);
  45.     if (!isset($single_table)) {
  46.         $hide_structure = true;
  47.         $hide_sql       = true;
  48.     } else {
  49.         // just to keep this value for possible next display of this form after saving on server
  50.         echo '    <input type="hidden" name="single_table" value="TRUE" />';
  51.     }
  52. }
  53. echo '    <input type="hidden" name="export_type" value="' . $export_type . '" />';
  54.  
  55. if (isset($sql_query)) {
  56.     echo '    <input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />';
  57. }
  58. ?>
  59.  
  60.     <script type="text/javascript">
  61.     <!--
  62.     function hide_them_all() {
  63.         getElement("csv_options").style.display = 'none';
  64.         getElement("excel_options").style.display = 'none';
  65.         getElement("latex_options").style.display = 'none';
  66.         getElement("htmlexcel_options").style.display = 'none';
  67.         getElement("htmlword_options").style.display = 'none';
  68. <?php if ($xls) { ?>
  69.         getElement("xls_options").style.display = 'none';
  70. <?php } ?>
  71. <?php if (!$hide_sql) { ?>
  72.         getElement("sql_options").style.display = 'none';
  73. <?php } ?>
  74.         getElement("none_options").style.display = 'none';
  75.     }
  76.  
  77.     function show_checked_option() {
  78.         hide_them_all();
  79.         if (getElement('radio_dump_latex').checked) {
  80.             getElement('latex_options').style.display = 'block';
  81.         } else if (getElement('radio_dump_htmlexcel').checked) {
  82.             getElement('htmlexcel_options').style.display = 'block';
  83.         } else if (getElement('radio_dump_htmlword').checked) {
  84.             getElement('htmlword_options').style.display = 'block';
  85. <?php if ($xls) { ?>
  86.         } else if (getElement('radio_dump_xls').checked) {
  87.             getElement('xls_options').style.display = 'block';
  88. <?php } ?>
  89. <?php if (!$hide_sql) { ?>
  90.         } else if (getElement('radio_dump_sql').checked) {
  91.             getElement('sql_options').style.display = 'block';
  92. <?php } ?>
  93. <?php if (!$hide_xml) { ?>
  94.         } else if (getElement('radio_dump_xml').checked) {
  95.             getElement('none_options').style.display = 'block';
  96. <?php } ?>
  97.         } else if (getElement('radio_dump_csv').checked) {
  98.             getElement('csv_options').style.display = 'block';
  99.         } else if (getElement('radio_dump_excel').checked) {
  100.             getElement('excel_options').style.display = 'block';
  101.         } else {
  102.             if (getElement('radio_dump_sql')) {
  103.                 getElement('radio_dump_sql').checked = true;
  104.                 getElement('sql_options').style.display = 'block';
  105.             } else if (getElement('radio_dump_csv')) {
  106.                 getElement('radio_dump_csv').checked = true;
  107.                 getElement('csv_options').style.display = 'block';
  108.             } else {
  109.                 getElement('none_options').style.display = 'block';
  110.             }
  111.         }
  112.     }
  113.     //-->
  114.     </script>
  115.  
  116.     <table cellpadding="3" border="0" cellspacing="0">
  117.     <tr>
  118.         <th colspan="3" valign="top" nowrap="nowrap" class="tblHeaders"><?php echo $export_page_title; ?></th>
  119.     </tr>
  120.     <tr>
  121.         <!-- Formats to export to -->
  122.         <td nowrap="nowrap" valign="top" onclick="if (typeof(window.opera) != 'undefined')setTimeout('show_checked_option()', 1); return true">
  123.             <table border="0" cellpadding="3" cellspacing="1">
  124.                 <tr><th align="left"><?php echo $strExport; ?></th></tr>
  125.             <?php
  126.             if (isset($multi_values) && $multi_values != '') {
  127.                 echo '                <tr><td bgcolor="' . $cfg['BgcolorOne'] . '">';
  128.                 echo $multi_values;
  129.                 echo '                </td></tr>';
  130.             }
  131.             ?>
  132.  
  133. <?php if (!$hide_sql) { ?>
  134.             <!-- SQL -->
  135.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  136.                     <input type="radio" name="what" value="sql" id="radio_dump_sql" onclick="if (this.checked) { hide_them_all(); getElement('sql_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'sql'); ?> style="vertical-align: middle" /><label for="radio_dump_sql"><?php echo $strSQL; ?> </label>
  137.                 </td></tr>
  138. <?php } ?>
  139.  
  140.             <!-- LaTeX table -->
  141.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  142.                     <input type="radio" name="what" value="latex" id="radio_dump_latex"  onclick="if (this.checked) { hide_them_all(); getElement('latex_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'latex'); ?> style="vertical-align: middle" /><label for="radio_dump_latex"><?php echo $strLaTeX; ?> </label>
  143.                 </td></tr>
  144.  
  145.  
  146.             <!-- HTML Excel -->
  147.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  148.                     <input type="radio" name="what" value="htmlexcel" id="radio_dump_htmlexcel"  onclick="if (this.checked) { hide_them_all(); getElement('htmlexcel_options').style.display = 'block'; getElement('checkbox_dump_asfile').checked = true;};  return true" <?php PMA_exportIsActive('format', 'htmlexcel'); ?> /><label for="radio_dump_htmlexcel"><?php echo $strHTMLExcel; ?></label>
  149.                </td></tr>
  150.  
  151.             <!-- HTML Word -->
  152.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  153.                     <input type="radio" name="what" value="htmlword" id="radio_dump_htmlword"  onclick="if (this.checked) { hide_them_all(); getElement('htmlword_options').style.display = 'block'; getElement('checkbox_dump_asfile').checked = true;};  return true" <?php PMA_exportIsActive('format', 'htmlword'); ?> /><label for="radio_dump_htmlword"><?php echo $strHTMLWord; ?></label>
  154.                </td></tr>
  155.  
  156. <?php if ($xls) { ?>
  157.             <!-- Native Excel -->
  158.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  159.                     <input type="radio" name="what" value="xls" id="radio_dump_xls"  onclick="if (this.checked) { hide_them_all(); getElement('xls_options').style.display = 'block'; getElement('checkbox_dump_asfile').checked = true;};  return true" <?php PMA_exportIsActive('format', 'xls'); ?> /><label for="radio_dump_xls"><?php echo $strStrucNativeExcel; ?></label>
  160.                </td></tr>
  161. <?php } ?>
  162.  
  163.             <!-- Excel CSV -->
  164.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  165.                     <input type="radio" name="what" value="excel" id="radio_dump_excel"  onclick="if (this.checked) { hide_them_all(); getElement('excel_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'excel'); ?> style="vertical-align: middle" /><label for="radio_dump_excel"><?php echo $strStrucExcelCSV; ?> </label>
  166.                 </td></tr>
  167.  
  168.             <!-- General CSV -->
  169.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  170.                     <input type="radio" name="what" value="csv" id="radio_dump_csv"  onclick="if (this.checked) { hide_them_all(); getElement('csv_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'csv'); ?> style="vertical-align: middle" /><label for="radio_dump_csv"><?php echo $strStrucCSV;?> </label>
  171.                 </td></tr>
  172.  
  173. <?php if (!$hide_xml) { ?>
  174.             <!-- XML -->
  175.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  176.                     <input type="radio" name="what" value="xml" id="radio_dump_xml" onclick="if (this.checked) { hide_them_all(); getElement('none_options').style.display = 'block'; }; return true" <?php PMA_exportIsActive('format', 'xml'); ?> style="vertical-align: middle" /><label for="radio_dump_xml"><?php echo $strXML; ?> </label>
  177.                 </td></tr>
  178. <?php } ?>
  179.             </table>
  180.         </td>
  181.         <!-- ltr item -->
  182.         <td valign="top"><img src="<?php echo $pmaThemeImage . 'item_ltr.png'; ?>" border="0" hspace="2" vspace="5" /></td>
  183.         <!-- Options -->
  184.         <td valign="top" id="options_td" width="400">
  185.  
  186. <?php if (!$hide_sql) { ?>
  187.             <!-- SQL options -->
  188.             <div id="sql_options">
  189.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  190.                 <tr>
  191.                     <th align="left">
  192.                     <?php
  193.                     echo $strSQLOptions;
  194.                     $goto_documentation = '<a href="./Documentation.html#faqexport" target="documentation">';
  195.                     echo ($cfg['ReplaceHelpImg'] ? '' : '(')
  196.                        . $goto_documentation
  197.                        . ($cfg['ReplaceHelpImg'] ? '<img src="' . $pmaThemeImage . 'b_help.png" border="0" alt="' .$strDocu . '" width="11" height="11" hspace="2" align="middle" />' : $strDocu)
  198.                        . '</a>' . ($cfg['ReplaceHelpImg'] ? '' : ')');
  199.                     ?>
  200.                     </th>
  201.                 </tr>
  202.                 <tr>
  203.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  204.                         <?php echo $strAddHeaderComment; ?>: <input type="text" name="header_comment" value="<?php echo $cfg['Export']['sql_header_comment']; ?>" class="textfield" size="30" style="vertical-align: middle" /><br />
  205.                         <input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" <?php PMA_exportCheckboxCheck('sql_use_transaction'); ?> style="vertical-align: middle" /><label for="checkbox_use_transaction"><?php echo $strEncloseInTransaction; ?></label><br />
  206.  
  207.                         <input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" <?php PMA_exportCheckboxCheck('sql_disable_fk'); ?> style="vertical-align: middle" /><label for="checkbox_disable_fk"><?php echo $strDisableForeignChecks; ?></label><br />
  208.                     </td>
  209.                 </tr>
  210. <?php
  211. if ($export_type == 'server') {
  212. ?>
  213.                 <!-- For databases -->
  214.                 <tr>
  215.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  216.                         <b><?php echo $strDatabaseExportOptions; ?>:</b><br />
  217.                         <input type="checkbox" name="drop_database" value="yes" id="checkbox_drop_database" <?php PMA_exportCheckboxCheck('sql_drop_database'); ?> style="vertical-align: middle" /><label for="checkbox_drop_database"><?php echo $strAddDropDatabase; ?></label>
  218.                     </td>
  219.                 </tr>
  220.  
  221. <?php
  222. }
  223. if (!$hide_structure) { ?>
  224.                 <!-- For structure -->
  225.                 <tr>
  226.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  227.                         <input type="checkbox" name="sql_structure" value="structure" id="checkbox_sql_structure" <?php PMA_exportCheckboxCheck('sql_structure'); ?> onclick="if (!this.checked && !getElement('checkbox_sql_data').checked) return false; else return true;" /><label for="checkbox_sql_structure"><b><?php echo $strStructure; ?>:</b></label><br />
  228.  
  229.                             <input type="checkbox" name="drop" value="1" id="checkbox_dump_drop" <?php PMA_exportCheckboxCheck('sql_drop_table'); ?> style="vertical-align: middle" /><label for="checkbox_dump_drop"><?php echo $strStrucDrop; ?></label><br />
  230.  
  231.                             <input type="checkbox" name="if_not_exists" value="1" id="checkbox_dump_if_not_exists" <?php PMA_exportCheckboxCheck('sql_if_not_exists'); ?> style="vertical-align: middle" /><label for="checkbox_dump_if_not_exists"><?php echo $strAddIfNotExists; ?></label><br />
  232.  
  233.                             <input type="checkbox" name="auto_increment" value="1" id="checkbox_auto_increment" <?php PMA_exportCheckboxCheck('sql_auto_increment'); ?> style="vertical-align: middle" /><label for="checkbox_auto_increment"><?php echo $strAddAutoIncrement; ?></label><br />
  234.  
  235.                             <input type="checkbox" name="use_backquotes" value="1" id="checkbox_dump_use_backquotes" <?php PMA_exportCheckboxCheck('sql_backquotes'); ?> style="vertical-align: middle" /><label for="checkbox_dump_use_backquotes"><?php echo $strUseBackquotes; ?></label><br />
  236.  
  237.                             <b><?php echo $strAddIntoComments; ?></b><br />
  238.  
  239.                                 <input type="checkbox" name="sql_dates" value="yes" id="checkbox_sql_dates" <?php PMA_exportCheckboxCheck('sql_dates'); ?> style="vertical-align: middle" /><label for="checkbox_sql_dates"><?php echo $strCreationDates; ?></label><br />
  240. <?php
  241.     if (!empty($cfgRelation['relation'])) {
  242. ?>
  243.                                 <input type="checkbox" name="sql_relation" value="yes" id="checkbox_sql_use_relation" <?php PMA_exportCheckboxCheck('sql_relation'); ?> style="vertical-align: middle" /><label for="checkbox_sql_use_relation"><?php echo $strRelations; ?></label><br />
  244. <?php
  245.     } // end relation
  246.     if (!empty($cfgRelation['commwork']) && PMA_MYSQL_INT_VERSION < 40100) {
  247. ?>
  248.                                 <input type="checkbox" name="sql_comments" value="yes" id="checkbox_sql_use_comments" <?php PMA_exportCheckboxCheck('sql_comments'); ?> style="vertical-align: middle" /><label for="checkbox_sql_use_comments"><?php echo $strComments; ?></label><br />
  249. <?php
  250.     } // end comments
  251.     if ($cfgRelation['mimework']) {
  252. ?>
  253.                                 <input type="checkbox" name="sql_mime" value="yes" id="checkbox_sql_use_mime" <?php PMA_exportCheckboxCheck('sql_mime'); ?> style="vertical-align: middle" /><label for="checkbox_sql_use_mime"><?php echo $strMIME_MIMEtype; ?></label><br />
  254. <?php
  255.     } // end MIME
  256.     if (PMA_MYSQL_INT_VERSION >= 40100) {
  257. ?>
  258.                         <label for="select_sql_compat"><?php echo $strSQLExportCompatibility; ?>: </label><select name="sql_compat" id="select_sql_compat" style="vertical-align: middle">
  259.                         <?php
  260.                         $compats = array('NONE');
  261.                         if (PMA_MYSQL_INT_VERSION >= 40101) {
  262.                             $compats[] = 'ANSI';
  263.                             $compats[] = 'DB2';
  264.                             $compats[] = 'MAXDB';
  265.                             $compats[] = 'MYSQL323';
  266.                             $compats[] = 'MYSQL40';
  267.                             $compats[] = 'MSSQL';
  268.                             $compats[] = 'ORACLE';
  269.                             $compats[] = 'POSTGRESQL';
  270.                             if (PMA_MYSQL_INT_VERSION >= 50001) {
  271.                                 $compats[] = 'TRADITIONAL';
  272.                             }
  273.                         }
  274.                         foreach ($compats as $x) {
  275.                             echo '<option value="' . $x . '"' . ($cfg['Export']['sql_compat'] == $x ? ' selected="selected"' : '' ) . '>' . $x . '</option>' . "\n";
  276.                         }
  277.                         ?>
  278.                         </select>
  279.                         <?php echo PMA_showMySQLDocu('manual_MySQL_Database_Administration', 'Server_SQL_mode') . "\n";
  280.     }
  281.     ?>
  282.                     </td>
  283.                 </tr>
  284. <?php
  285. } // end STRUCTURE
  286. ?>
  287.  
  288.                 <!-- For data -->
  289.                 <tr>
  290.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  291.                         <input type="checkbox" name="sql_data" value="data" id="checkbox_sql_data" <?php PMA_exportCheckboxCheck('sql_data'); ?> onclick="if (!this.checked && (!getElement('checkbox_sql_structure') || !getElement('checkbox_sql_structure').checked)) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_sql_data"><b><?php echo $strData; ?>:</b></label><br />
  292.  
  293.                             <input type="checkbox" name="showcolumns" value="yes" id="checkbox_dump_showcolumns" <?php PMA_exportCheckboxCheck('sql_columns'); ?> style="vertical-align: middle" /><label for="checkbox_dump_showcolumns"><?php echo $strCompleteInserts; ?></label><br />
  294.  
  295.                             <input type="checkbox" name="extended_ins" value="yes" id="checkbox_dump_extended_ins" <?php PMA_exportCheckboxCheck('sql_extended'); ?> style="vertical-align: middle" /><label for="checkbox_dump_extended_ins"><?php echo $strExtendedInserts; ?></label><br />
  296.  
  297.                             <input type="checkbox" name="delayed" value="yes" id="checkbox_dump_delayed" <?php PMA_exportCheckboxCheck('sql_delayed'); ?> style="vertical-align: middle" /><label for="checkbox_dump_delayed"><?php echo $strDelayedInserts; ?></label><br />
  298.  
  299.                             <input type="checkbox" name="sql_ignore" value="yes" id="checkbox_dump_ignore" <?php PMA_exportCheckboxCheck('sql_ignore'); ?> style="vertical-align: middle" /><label for="checkbox_dump_ignore"><?php echo $strIgnoreInserts; ?></label><br />
  300.  
  301.                             <input type="checkbox" name="hexforbinary" value="yes" id="checkbox_hexforbinary" <?php PMA_exportCheckboxCheck('sql_hex_for_binary'); ?> style="vertical-align: middle" /><label for="checkbox_hexforbinary"><?php echo $strHexForBinary; ?></label><br />
  302.  
  303.                         <label for="select_sql_type"><?php echo $strSQLExportType; ?>: </label><select name="sql_type" id="select_sql_type" style="vertical-align: middle">
  304.                             <option value="insert"<?php echo $cfg['Export']['sql_type'] == 'insert' ? ' selected="selected"' : ''; ?>>INSERT</option>
  305.                             <option value="update"<?php echo $cfg['Export']['sql_type'] == 'update' ? ' selected="selected"' : ''; ?>>UPDATE</option>
  306.                             <option value="replace"<?php echo $cfg['Export']['sql_type'] == 'replace' ? ' selected="selected"' : ''; ?>>REPLACE</option>
  307.                         </select>
  308.                     </td>
  309.                 </tr>
  310.                 </table>
  311.             </div>
  312. <?php
  313. } // end SQL-OPTIONS
  314. ?>
  315.  
  316.             <!-- LaTeX options -->
  317.             <div id="latex_options">
  318.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  319.                 <tr><th align="left"><?php echo $strLaTeXOptions; ?></th></tr>
  320.                 <tr>
  321.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  322.                         <input type="checkbox" name="latex_caption" value="yes" id="checkbox_latex_show_caption" <?php PMA_exportCheckboxCheck('latex_caption'); ?> style="vertical-align: middle" /><label for="checkbox_latex_show_caption"><?php echo $strLatexIncludeCaption; ?></label><br />
  323.                     </td>
  324.                 </tr>
  325.  
  326. <?php if (!$hide_structure) { ?>
  327.                 <!-- For structure -->
  328.                 <tr>
  329.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  330.                     <input type="checkbox" name="latex_structure" value="structure" id="checkbox_latex_structure" <?php PMA_exportCheckboxCheck('latex_structure'); ?> onclick="if (!this.checked && !getElement('checkbox_latex_data').checked) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_latex_structure"><b><?php echo $strStructure; ?></b></label><br />
  331.                     <table border="0" cellspacing="1" cellpadding="0">
  332.                         <tr>
  333.                             <td>     </td>
  334.                             <td><?php echo $strLatexCaption; ?> </td>
  335.                             <td>
  336.                                 <input type="text" name="latex_structure_caption" size="30" value="<?php echo $strLatexStructure; ?>" class="textfield" style="vertical-align: middle" />
  337.                             </td>
  338.                         </tr>
  339.                         <tr>
  340.                             <td> </td>
  341.                             <td><?php echo $strLatexContinuedCaption; ?> </td>
  342.                             <td>
  343.                                 <input type="text" name="latex_structure_continued_caption" size="30" value="<?php echo $strLatexStructure . ' ' . $strLatexContinued; ?>" class="textfield" style="vertical-align: middle" />
  344.                             </td>
  345.                         </tr>
  346.                         <tr>
  347.                             <td> </td>
  348.                             <td><?php echo $strLatexLabel; ?> </td>
  349.                             <td>
  350.                                 <input type="text" name="latex_structure_label" size="30" value="<?php echo $cfg['Export']['latex_structure_label']; ?>" class="textfield" style="vertical-align: middle" />
  351.                             </td>
  352.                         </tr>
  353.                     </table>
  354. <?php
  355.     if (!empty($cfgRelation['relation'])) {
  356. ?>
  357.                         <input type="checkbox" name="latex_relation" value="yes" id="checkbox_latex_use_relation" <?php PMA_exportCheckboxCheck('latex_relation'); ?> style="vertical-align: middle" /><label for="checkbox_latex_use_relation"><?php echo $strRelations; ?></label><br />
  358. <?php
  359.     } // end relation
  360.     if ($cfgRelation['commwork']) {
  361. ?>
  362.                         <input type="checkbox" name="latex_comments" value="yes" id="checkbox_latex_use_comments" <?php PMA_exportCheckboxCheck('latex_comments'); ?> style="vertical-align: middle" /><label for="checkbox_latex_use_comments"><?php echo $strComments; ?></label><br />
  363. <?php
  364.     } // end comments
  365.     if ($cfgRelation['mimework']) {
  366. ?>
  367.                         <input type="checkbox" name="latex_mime" value="yes" id="checkbox_latex_use_mime" <?php PMA_exportCheckboxCheck('latex_mime'); ?> style="vertical-align: middle" /><label for="checkbox_latex_use_mime"><?php echo $strMIME_MIMEtype; ?></label><br />
  368. <?php
  369.     } // end MIME
  370. ?>
  371.                 </td>
  372.             </tr>
  373. <?php
  374. } // end STRUCTURE
  375. ?>
  376.             <!-- For data -->
  377.             <tr>
  378.                 <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  379.                     <input type="checkbox" name="latex_data" value="data" id="checkbox_latex_data" <?php PMA_exportCheckboxCheck('latex_data'); ?> onclick="if (!this.checked && (!getElement('checkbox_latex_structure') || !getElement('checkbox_latex_structure').checked)) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_latex_data"><b><?php echo $strData; ?>:</b></label><br />
  380.                         <input type="checkbox" name="latex_showcolumns" value="yes" id="ch_latex_showcolumns" <?php PMA_exportCheckboxCheck('latex_columns'); ?> style="vertical-align: middle" /><label for="ch_latex_showcolumns"><?php echo $strColumnNames; ?></label><br />
  381.                     <table border="0" cellspacing="1" cellpadding="0">
  382.                         <tr>
  383.                             <td>    </td>
  384.                             <td><?php echo $strLatexCaption; ?> </td>
  385.                             <td>
  386.                                 <input type="text" name="latex_data_caption" size="30" value="<?php echo $strLatexContent; ?>" class="textfield" style="vertical-align: middle" />
  387.                             </td>
  388.                         </tr>
  389.                         <tr>
  390.                             <td> </td>
  391.                             <td><?php echo $strLatexContinuedCaption; ?> </td>
  392.                             <td>
  393.                                 <input type="text" name="latex_data_continued_caption" size="30" value="<?php echo $strLatexContent . ' ' . $strLatexContinued; ?>" class="textfield" style="vertical-align: middle" />
  394.                             </td>
  395.                         </tr>
  396.                         <tr>
  397.                             <td> </td>
  398.                             <td><?php echo $strLatexLabel; ?> </td>
  399.                             <td>
  400.                                 <input type="text" name="latex_data_label" size="30" value="<?php echo $cfg['Export']['latex_data_label']; ?>" class="textfield" style="vertical-align: middle" />
  401.                             </td>
  402.                         </tr>
  403.                         <tr>
  404.                             <td> </td>
  405.                             <td><?php echo $strReplaceNULLBy; ?> </td>
  406.                             <td>
  407.                                 <input type="text" name="latex_replace_null" size="20" value="<?php echo $cfg['Export']['latex_null']; ?>" class="textfield" style="vertical-align: middle" />
  408.                             </td>
  409.                         </tr>
  410.                     </table>
  411.                 </td>
  412.             </tr>
  413.             </table>
  414.             </div>
  415.  
  416.             <!-- CSV options -->
  417.             <div id="csv_options">
  418.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  419.                 <tr><th align="left">
  420.                     <?php echo $strCSVOptions; ?><input type="hidden" name="csv_data" value="csv_data" />
  421.                 </th></tr>
  422.                 <tr>
  423.                     <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  424.                     <table border="0" cellspacing="1" cellpadding="0">
  425.                     <tr>
  426.                         <td>
  427.                             <?php echo $strFieldsTerminatedBy; ?> 
  428.                         </td>
  429.                         <td>
  430.                             <input type="text" name="separator" size="2" value="<?php echo $cfg['Export']['csv_separator']; ?>" class="textfield" style="vertical-align: middle" />
  431.                         </td>
  432.                     </tr>
  433.                     <tr>
  434.                         <td>
  435.                             <?php echo $strFieldsEnclosedBy; ?> 
  436.                         </td>
  437.                         <td>
  438.                             <input type="text" name="enclosed" size="2" value="<?php echo $cfg['Export']['csv_enclosed']; ?>" class="textfield" style="vertical-align: middle" />
  439.                         </td>
  440.                     </tr>
  441.                     <tr>
  442.                         <td>
  443.                             <?php echo $strFieldsEscapedBy; ?> 
  444.                         </td>
  445.                         <td>
  446.                             <input type="text" name="escaped" size="2" value="<?php echo $cfg['Export']['csv_escaped']; ?>" class="textfield" style="vertical-align: middle" />
  447.                         </td>
  448.                     </tr>
  449.                     <tr>
  450.                         <td>
  451.                             <?php echo $strLinesTerminatedBy; ?> 
  452.                         </td>
  453.                         <td>
  454.                             <input type="text" name="add_character" size="2" value="<?php if ($cfg['Export']['csv_terminated'] == 'AUTO') echo ((PMA_whichCrlf() == "\n") ? '\n' : '\r\n'); else echo $cfg['Export']['csv_terminated']; ?>" class="textfield" style="vertical-align: middle" />
  455.                         </td>
  456.                     </tr>
  457.                     <tr>
  458.                         <td>
  459.                             <?php echo $strReplaceNULLBy; ?> 
  460.                         </td>
  461.                         <td>
  462.                             <input type="text" name="csv_replace_null" size="20" value="<?php echo $cfg['Export']['csv_null']; ?>" class="textfield" style="vertical-align: middle" />
  463.                         </td>
  464.                     </tr>
  465.                 </table>
  466.                 <input type="checkbox" name="showcsvnames" value="yes" id="checkbox_dump_showcsvnames" <?php PMA_exportCheckboxCheck('csv_columns'); ?> style="vertical-align: middle" /><label for="checkbox_dump_showcsvnames"><?php echo $strPutColNames; ?></label>
  467.             </td>
  468.         </tr>
  469.         </table>
  470.         </div>
  471.  
  472.         <!-- Excel options -->
  473.         <div id="excel_options">
  474.         <table width="400" border="0" cellpadding="3" cellspacing="1">
  475.                 <tr><th align="left">
  476.                     <?php echo $strExcelOptions; ?>
  477.                     <input type="hidden" name="excel_data" value="excel_data" />
  478.                 </th></tr>
  479.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  480.                 <table border="0" cellspacing="1" cellpadding="0">
  481.                     <tr>
  482.                         <td>
  483.                             <?php echo $strReplaceNULLBy; ?> 
  484.                         </td>
  485.                         <td>
  486.                             <input type="text" name="excel_replace_null" size="20" value="<?php echo $cfg['Export']['excel_null']; ?>" class="textfield" style="vertical-align: middle" />
  487.                         </td>
  488.                     </tr>
  489.                     <tr>
  490.                         <td colspan="2">
  491.                             <input type="checkbox" name="showexcelnames" value="yes" id="checkbox_dump_showexcelnames" <?php PMA_exportCheckboxCheck('excel_columns'); ?> style="vertical-align: middle" /><label for="checkbox_dump_showexcelnames"><?php echo $strPutColNames; ?></label>
  492.                         </td>
  493.                     </tr>
  494.                     <tr>
  495.                         <td>
  496.                             <label for="select_excel_edition">
  497.                                 <?php echo $strExcelEdition; ?>: 
  498.                             </label>
  499.                         </td>
  500.                         <td>
  501.                             <select name="excel_edition" id="select_excel_edition" style="vertical-align: middle">
  502.                                 <option value="win"<?php echo $cfg['Export']['excel_edition'] == 'win' ? ' selected="selected"' : ''; ?>>Windows</option>
  503.                                 <option value="mac"<?php echo $cfg['Export']['excel_edition'] == 'mac' ? ' selected="selected"' : ''; ?>>Excel 2003 / Macintosh</option>
  504.                             </select>
  505.                         </td>
  506.                     </tr>
  507.                 </table>
  508.                 </td></tr>
  509.             </table>
  510.             </div>
  511.  
  512.  
  513.             <!-- HTML Excel options -->
  514.             <div id="htmlexcel_options">
  515.                 <table border="0" cellspacing="1" cellpadding="0" width="400">
  516.                     <tr>
  517.                         <th align="left">
  518.                            <b><?php echo $strHTMLExcelOptions; ?></b>
  519.                            <input type="hidden" name="htmlexcel_data" value="htmlexcel_data" />
  520.                         </th>
  521.                    </tr>
  522.                    <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  523.                 <table border="0" cellspacing="1" cellpadding="0">
  524.                        <tr>
  525.                            <td>
  526.                             <?php echo $strReplaceNULLBy; ?> 
  527.                         </td>
  528.                         <td>
  529.                             <input type="text" name="htmlexcel_replace_null" size="20" value="<?php echo $cfg['Export']['htmlexcel_null']; ?>" class="textfield" />
  530.                         </td>
  531.                     </tr>
  532.                     <tr>
  533.                         <td>
  534.                             <input type="checkbox" name="htmlexcel_shownames" value="yes" id="checkbox_dump_htmlexcel_shownames" <?php PMA_exportCheckboxCheck('htmlexcel_columns'); ?> /><label for="checkbox_dump_htmlexcel_shownames"><?php echo $strPutColNames; ?></label>
  535.                         </td>
  536.                     </tr>
  537.                 </table>
  538.                     </td></tr>
  539.                </table>
  540.             </div>
  541.  
  542.  
  543.             <!-- HTML Word options -->
  544.             <div id="htmlword_options">
  545.                 <table border="0" cellspacing="1" cellpadding="0" width="400">
  546.                     <tr>
  547.                         <th align="left">
  548.                            <b><?php echo $strHTMLWordOptions; ?></b>
  549.                         </th>
  550.                    </tr>
  551.                    <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  552.                     <input type="checkbox" name="htmlword_structure" value="structure" id="checkbox_htmlword_structure" <?php PMA_exportCheckboxCheck('htmlword_structure'); ?> onclick="if (!this.checked && (!getElement('checkbox_htmlword_data') || !getElement('checkbox_htmlword_data').checked)) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_htmlword_structure"><b><?php echo $strStructure; ?></b></label><br />
  553.                     </td></tr>
  554.                    <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  555.                     <input type="checkbox" name="htmlword_data" value="data" id="checkbox_htmlword_data" <?php PMA_exportCheckboxCheck('htmlword_data'); ?> onclick="if (!this.checked && (!getElement('checkbox_htmlword_structure') || !getElement('checkbox_htmlword_structure').checked)) return false; else return true;" style="vertical-align: middle" /><label for="checkbox_htmlword_data"><b><?php echo $strData; ?>:</b></label><br />
  556.                 <table border="0" cellspacing="1" cellpadding="0">
  557.                        <tr>
  558.                            <td>
  559.                                 <?php echo $strReplaceNULLBy; ?> 
  560.                         </td>
  561.                         <td>
  562.                             <input type="text" name="htmlword_replace_null" size="20" value="<?php echo $cfg['Export']['htmlword_null']; ?>" class="textfield" />
  563.                         </td>
  564.                     </tr>
  565.                     <tr>
  566.                         <td>
  567.                                 <input type="checkbox" name="htmlword_shownames" value="yes" id="checkbox_dump_htmlword_shownames" <?php PMA_exportCheckboxCheck('htmlword_columns'); ?> /><label for="checkbox_dump_htmlword_shownames"><?php echo $strPutColNames; ?></label>
  568.                         </td>
  569.                     </tr>
  570.                 </table>
  571.                     </td></tr>
  572.                </table>
  573.             </div>
  574.  
  575.  
  576. <?php if ($xls) { ?>
  577.             <!-- Native Excel options -->
  578.             <div id="xls_options">
  579.                 <table border="0" cellspacing="1" cellpadding="0" width="400">
  580.                     <tr>
  581.                         <th align="left">
  582.                            <b><?php echo $strExcelOptions; ?></b>
  583.                            <input type="hidden" name="xls_data" value="xls_data" />
  584.                         </th>
  585.                    </tr>
  586.                    <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  587.                 <table border="0" cellspacing="1" cellpadding="0">
  588.                        <tr>
  589.                            <td>
  590.                             <?php echo $strReplaceNULLBy; ?> 
  591.                         </td>
  592.                         <td>
  593.                             <input type="text" name="xls_replace_null" size="20" value="<?php echo $cfg['Export']['xls_null']; ?>" class="textfield" />
  594.                         </td>
  595.                     </tr>
  596.                     <tr>
  597.                         <td>
  598.                             <input type="checkbox" name="xls_shownames" value="yes" id="checkbox_dump_xls_shownames" <?php PMA_exportCheckboxCheck('xls_columns'); ?> /><label for="checkbox_dump_xls_shownames"><?php echo $strPutColNames; ?></label>
  599.                         </td>
  600.                     </tr>
  601.                 </table>
  602.                     </td></tr>
  603.                </table>
  604.             </div>
  605. <?php } ?>
  606.  
  607.             <div id="none_options">
  608.             <table width="400" border="0" cellpadding="3" cellspacing="1">
  609.                 <tr><th align="left"><?php echo $strXML; ?></th></tr>
  610.                 <tr><td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  611.                     <?php echo $strNoOptions; ?>
  612.                     <input type="hidden" name="xml_data" value="xml_data" />
  613.                 </td></tr>
  614.             </table>
  615.             </div>
  616.             <script type="text/javascript">
  617.             <!--
  618.                 show_checked_option();
  619.             //-->
  620.             </script>
  621.         </td>
  622.     </tr>
  623. <?php
  624. if (isset($table) && !empty($table) && !isset($num_tables)) {
  625. ?>
  626.     <tr>
  627.         <td colspan="3" align="center">
  628.           <div style="background-color: <?php echo $cfg['BgcolorOne']; ?>; padding: 3px; margin: 1px;">
  629.            <b><?php echo sprintf($strDumpXRows , '<input type="text" name="limit_to" size="5" value="' . (isset($unlim_num_rows)?$unlim_num_rows: PMA_countRecords($db, $table, TRUE)) . '" class="textfield" style="vertical-align: middle" onfocus="this.select()" style="vertical-align: middle; text-align: center;" />' , '<input type="text" name="limit_from" value="0" size="5" class="textfield" style="vertical-align: middle" onfocus="this.select()" style="vertical-align: middle; text-align: center;" />') . "\n"; ?></b>
  630.           </div>
  631.         </td>
  632.     </tr>
  633. <?php
  634. }
  635. ?>
  636.  
  637.     <tr>
  638.         <!-- Export to screen or to file -->
  639.         <td colspan="3">
  640.         <table width="100%" border="0" cellpadding="3" cellspacing="1">
  641.         <tr>
  642.             <th align="left">
  643.             <input type="checkbox" name="asfile" value="sendit" id="checkbox_dump_asfile" <?php PMA_exportCheckboxCheck('asfile'); ?> style="vertical-align: middle" /><label for="checkbox_dump_asfile"><b><?php echo $strSend; ?></b></label>
  644.             </th>
  645.         </tr>
  646.         <tr>
  647.             <td bgcolor="<?php echo $cfg['BgcolorOne']; ?>">
  648.                 <?php if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { ?>
  649.                     <input type="checkbox" name="onserver" value="saveit" id="checkbox_dump_onserver"  onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportCheckboxCheck('onserver'); ?> style="vertical-align: middle" /><label for="checkbox_dump_onserver"><?php echo sprintf($strSaveOnServer, htmlspecialchars($cfg['SaveDir'])); ?></label>,<br />
  650.                     <input type="checkbox" name="onserverover" value="saveitover" id="checkbox_dump_onserverover"  onclick="getElement('checkbox_dump_onserver').checked = true;getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportCheckboxCheck('onserver_overwrite'); ?> style="vertical-align: middle" /><label for="checkbox_dump_onserverover"><?php echo $strOverwriteExisting; ?></label>
  651.                 <br />
  652.                 <?php } ?>
  653.  
  654.                     <?php echo $strFileNameTemplate; ?>: 
  655.                 <input type="text" name="filename_template"
  656.                 <?php
  657.                     echo ' value="';
  658.                     if ($export_type == 'database') {
  659.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_db_filename_template'])) {
  660.                             echo $_COOKIE['pma_db_filename_template'];
  661.                         } else {
  662.                             echo '__DB__';
  663.                         }
  664.                     } elseif ($export_type == 'table') {
  665.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_table_filename_template'])) {
  666.                             echo $_COOKIE['pma_table_filename_template'];
  667.                         } else {
  668.                             echo '__TABLE__';
  669.                         }
  670.                     } else {
  671.                         if (isset($_COOKIE) && !empty($_COOKIE['pma_server_filename_template'])) {
  672.                             echo $_COOKIE['pma_server_filename_template'];
  673.                         } else {
  674.                             echo '__SERVER__';
  675.                         }
  676.                     }
  677.                     echo '" ';
  678.                 ?> style="vertical-align: middle" />
  679.                 (
  680.                 <input type="checkbox" name="remember_template" id="checkbox_remember_template" <?php PMA_exportCheckboxCheck('remember_file_template'); ?> style="vertical-align: middle" /><label for="checkbox_remember_template"><?php echo $strFileNameTemplateRemember; ?></label>
  681.                 )*
  682.  
  683.                 <?php
  684.                 // charset of file
  685.                 if ($cfg['AllowAnywhereRecoding'] && $allow_recoding) {
  686.                     echo '<br /><label for="select_charset_of_file">' . $strCharsetOfFile . '</label>';
  687.                     echo "\n";
  688.  
  689.                     $temp_charset = reset($cfg['AvailableCharsets']);
  690.                     echo '<select id="select_charset_of_file" name="charset_of_file" size="1">' . "\n"
  691.                             . '                <option value="' . $temp_charset . '"';
  692.                     if ($temp_charset == $charset) {
  693.                         echo ' selected="selected"';
  694.                     }
  695.                     echo '>' . $temp_charset . '</option>' . "\n";
  696.                     while ($temp_charset = next($cfg['AvailableCharsets'])) {
  697.                         echo '                <option value="' . $temp_charset . '"';
  698.                         if ($temp_charset == $charset) {
  699.                             echo ' selected="selected"';
  700.                         }
  701.                         echo '>' . $temp_charset . '</option>' . "\n";
  702.                     } // end while
  703.                     echo '            </select>';
  704.                 } // end if
  705.                 echo "\n";
  706.                 ?>
  707.                 <br />
  708.                     <b><?php echo $strCompression; ?></b><br />
  709.                         <input type="radio" name="compression" value="none" id="radio_compression_none" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'none'); ?> style="vertical-align: middle" /><label for="radio_compression_none"><?php echo $strNone; ?></label>
  710.   
  711.  
  712. <?php
  713.  
  714. // zip, gzip and bzip2 encode features
  715. $is_zip  = (isset($cfg['ZipDump']) && $cfg['ZipDump'] && @function_exists('gzcompress'));
  716. $is_gzip = (isset($cfg['GZipDump']) && $cfg['GZipDump'] && @function_exists('gzencode'));
  717. $is_bzip = (isset($cfg['BZipDump']) && $cfg['BZipDump'] && @function_exists('bzcompress'));
  718. if ($is_zip || $is_gzip || $is_bzip) {
  719.     if ($is_zip) {
  720.         ?>
  721.                 <input type="radio" name="compression" value="zip" id="radio_compression_zip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'zip'); ?> style="vertical-align: middle" /><label for="radio_compression_zip"><?php echo $strZip; ?></label><?php echo (($is_gzip || $is_bzip) ? '  ' : ''); ?>
  722.         <?php
  723.     }
  724.     if ($is_gzip) {
  725.         echo "\n"
  726.         ?>
  727.                 <input type="radio" name="compression" value="gzip" id="radio_compression_gzip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'gzip'); ?> style="vertical-align: middle" /><label for="radio_compression_gzip"><?php echo $strGzip; ?></label><?php echo ($is_bzip ? '  ' : ''); ?>
  728.         <?php
  729.     }
  730.     if ($is_bzip) {
  731.         echo "\n"
  732.         ?>
  733.                 <input type="radio" name="compression" value="bzip" id="radio_compression_bzip" onclick="getElement('checkbox_dump_asfile').checked = true;" <?php PMA_exportIsActive('compression', 'bzip'); ?> style="vertical-align: middle" /><label for="radio_compression_bzip"><?php echo $strBzip; ?></label>
  734.         <?php
  735.     }
  736. }
  737. echo "\n";
  738. ?>
  739.             </td>
  740.         </tr>
  741.         </table>
  742.         </td>
  743.     </tr>
  744.  
  745. <?php
  746. // Encoding setting form appended by Y.Kawada
  747. if (function_exists('PMA_set_enc_form')) {
  748.     ?>
  749.     <tr>
  750.         <!-- Japanese encoding setting -->
  751.         <td colspan="3" align="center">
  752.     <?php
  753.     echo PMA_set_enc_form('            ');
  754.     ?>
  755.         </td>
  756.     </tr>
  757.     <?php
  758. }
  759. echo "\n";
  760. ?>
  761.     <tr>
  762.         <td colspan="3" align="right" class="tblFooters">
  763.             <input type="submit" value="<?php echo $strGo; ?>" id="buttonGo" />
  764.         </td>
  765.     </tr>
  766.     </table>
  767. </form>
  768. <br />
  769. <table border="0" cellpadding="0" cellspacing="0" width="600">
  770. <tr>
  771.     <td valign="top">* </td>
  772.     <td>
  773.         <?php echo sprintf($strFileNameTemplateHelp, '<a href="http://www.php.net/manual/function.strftime.php" target="documentation" title="' . $strDocu . '">', '</a>') . "\n"; ?>
  774.  
  775.     </td>
  776. </tr>
  777. </table>
  778.